API.cookies.getAllCookieStores   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
7
8
/* global API */
9
10
API.cookies = {
11
    get: function (details) {
12
        if (API.promise) {
13
            return API.api.cookies.get(details);
14
        }
15
        else {
16
            return new C_Promise(function () {
17
                API.api.cookies.get(details, (function (cookie) {
18
                    this.call_then(cookie);
19
                }).bind(this));
20
            });
21
        }
22
    },
23
    getAll: function (details) {
24
        if (API.promise) {
25
            return API.api.cookies.getAll(details);
26
        }
27
        else {
28
            return new C_Promise(function () {
29
                API.api.cookies.getAll(details, (function (cookie) {
30
                    this.call_then(cookie);
31
                }).bind(this));
32
            });
33
        }
34
    },
35
    set: function (details) {
36
        if (API.promise) {
37
            return API.api.cookies.set(details);
38
        }
39
        else {
40
            return new C_Promise(function () {
41
                API.api.cookies.set(details, (function (cookie) {
42
                    this.call_then(cookie);
43
                }).bind(this));
44
            });
45
        }
46
    },
47
    remove: function (details) {
48
        if (API.promise) {
49
            return API.api.cookies.remove(details);
50
        }
51
        else {
52
            return new C_Promise(function () {
53
                API.api.cookies.remove(details, (function (cookie) {
54
                    this.call_then(cookie);
55
                }).bind(this));
56
            });
57
        }
58
    },
59
    getAllCookieStores: function (details) {
60
        if (API.promise) {
61
            return API.api.cookies.getAllCookieStores(details);
62
        }
63
        else {
64
            return new C_Promise(function () {
65
                API.api.cookies.getAllCookieStores(details, (function (cookie) {
66
                    this.call_then(cookie);
67
                }).bind(this));
68
            });
69
        }
70
    }
71
};